var express = require('express');
var routerHelper = require('../utils/routerHelper');
var router = routerHelper(express.Router());
//var router = express.Router();
var path = require('path');
var fs = require('fs');

var controllerPath = path.join(__dirname, '../controllers');

fs
  .readdirSync(controllerPath)
  .filter(function(file) {
    return (file.indexOf('.js') > 0);
  })
  .forEach(function(file){
    //console.log(file);
  	var controller = require(path.join(controllerPath, file));
  	if ('registerPath' in controller) {
  		controller.registerPath(router);
  	}
  });

module.exports = router;



